/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TemplateLibraryPanel.java
 *
 * Created on Jan 14, 2010, 8:48:05 AM
 */

package dae.fxcreator.io.templates.ui;

import dae.fxcreator.io.templates.NodeTemplateLibrary;

/**
 * This panel shows the various node groups and the nodes inside of it.
 * @author Koen
 */
public class TemplateLibraryPanel extends javax.swing.JPanel {
    private NodeTemplateLibrary library;

    /** Creates new form TemplateLibraryPanel */
    public TemplateLibraryPanel() {
        initComponents();
    }

    /**
     * Sets the model for this NodeTemplateLibrary panel.
     * @param library the model to show.
     */
    public void setModel(NodeTemplateLibrary library){
        this.library = library;
        templateLibraryTree.setModel(library);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        splitNodePanel = new javax.swing.JSplitPane();
        scrTree = new javax.swing.JScrollPane();
        templateLibraryTree = new org.jdesktop.swingx.JXTree();

        splitNodePanel.setDividerLocation(150);

        templateLibraryTree.setRootVisible(false);
        scrTree.setViewportView(templateLibraryTree);

        splitNodePanel.setLeftComponent(scrTree);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(splitNodePanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(splitNodePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane scrTree;
    private javax.swing.JSplitPane splitNodePanel;
    private org.jdesktop.swingx.JXTree templateLibraryTree;
    // End of variables declaration//GEN-END:variables

}
